home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / TMPFILE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  402 b   |  16 lines

  1. /* tmpfile.c --- p 469 */
  2. #include <stdio.h>
  3. char   message[80] = "Testing tmpfile.... ";
  4. main()
  5. {
  6.     FILE *tfile;
  7.     if ((tfile = tmpfile()) == NULL)
  8.         perror("tmpfile failed");
  9.     else
  10.     {
  11.           printf("Temporary file successfully opened.\n");
  12.         printf("Wrote %d characters to file\n",
  13.              fwrite((void *)message, sizeof(char), 80, tfile));
  14.         printf("File will be gone when you exit.\n");
  15.     }
  16. }